home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Text Processing / Dataman 2.0.2 / Installed Instructions / Alphabetize Lines / Alphabetize Lines
Encoding:
Text File  |  1992-05-14  |  789 b   |  29 lines  |  [DMN1/DMAN]

  1. % Alphabetizes entries in Window 1 into a new, untitled document in Window 2
  2. % Assumes text being alphabetized does not begin with the ASCII 255 character.
  3. p b2 
  4. % STEP 1: Make temporary entry in Window 2 so Find will always find an alphabetically higher line.
  5. w ˇ^p
  6. p 1 What file do you wish to alphabetize?
  7. % STEP 2: Look for each line in the original.
  8. s o ^1-2000[!^p]
  9. % STEP 3: Switch to new window, go to top of document.
  10. p 2 
  11. m gou1
  12. % STEP 4: Look for first line alphabetically greater than copied string.
  13. s con ^1-2000[!^p]>"^&"
  14. b
  15. % STEP 5: Move to beginning of that line.
  16. m gol1
  17. % STEP 6: Write copied string and a carriage return.
  18. w ^&^p
  19. p 1 
  20. b
  21. % STEP 7: Get rid of that temporary entry.
  22. p 2 
  23. m god1
  24. s nr ˇ^p
  25. c b 
  26. b
  27. b
  28.